﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model.Data
{
    public class ItemType
    {
        private static Dictionary<string, Type> tagDic = new Dictionary<string, Type>();

        public static Dictionary<string, Type> TagDic { get => tagDic; set => tagDic = value; }

        public static Type Match(string tag)
        {
            if (string.IsNullOrEmpty(tag)) return Type.UNKNOWN;

            foreach (var item in TagDic)
            {
                string _tag = item.Key;
                Type _type = item.Value;

                if (tag.Equals(_tag))
                {
                    return _type;
                }
            }

            //if (tag.Equals("中福1"))
            //{
            //    return Type.ZHONG_FU;
            //}
            //if (tag.Equals("恒源"))
            //{
            //    return Type.HENG_YUAN;
            //}
            //if (tag.Equals("鑫大橡"))
            //{
            //    return Type.XinDaXiang;
            //}
            return Type.UNKNOWN;
        }

        public enum Type
        {
            UNKNOWN,
            ZHONG_FU,
            HENG_YUAN,
            XinDaXiang,
        }
    }
}
